# The two files are similar so I can use them interchangeably
print "Program Begins..."
initValue = 1.0
print initValue,
for i in range(0,20):
    initValue = initValue / 2
    print initValue,
exit(1)


file0PostingDict = {}
inputFileName0 = "/Users/weijiang/Desktop/dataWorkOn20140111Night/setOfTOP10Postings_head95K_COMPLETE_postingRankInListAdded"
inputFileHandler = open(inputFileName0,"r")
for line in inputFileHandler.readlines():
    lineElements = line.strip().split(" ")
    accessKey = lineElements[-2] + "_" + lineElements[-3]
    if accessKey not in file0PostingDict:
        file0PostingDict[accessKey] = 1
print "len(file0PostingDict): ",len(file0PostingDict)
inputFileHandler.close()

file1PostingDict = {}
inputFileName1 = "/Users/weijiang/Desktop/dataWorkOn20140111Night/TOP10PostingsWithTheirRanksFrom95KTrainingQueries"
inputFileHandler = open(inputFileName1,"r")
for line in inputFileHandler.readlines():
    lineElements = line.strip().split(" ")
    accessKey = lineElements[0] + "_" + lineElements[1]
    if accessKey not in file1PostingDict:
        file1PostingDict[accessKey] = 1
print "len(file1PostingDict): ",len(file1PostingDict)
inputFileHandler.close()

tempCounterNotIn = 0
tempCounterIn = 0
for accessKey in file1PostingDict:
    if accessKey not in file0PostingDict:
        tempCounterNotIn += 1
    else:
        tempCounterIn += 1

print "tempCounterIn: ",tempCounterIn
print "tempCounterNotIn: ",tempCounterNotIn
print "Program Ends."